<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Qt 4.3: pages.cpp Example File (dialogs/configdialog/pages.cpp)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">pages.cpp Example File<br /><sup><sup>dialogs/configdialog/pages.cpp</sup></sup></h1>
<pre><span class="comment"> /****************************************************************************
 **
 ** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
 **
 ** This file is part of the documentation of the Qt Toolkit.
 **
 ** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file.  Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. 
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
 **
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 **
 ****************************************************************************/</span>

 #include &lt;QtGui&gt;

 #include &quot;pages.h&quot;

 ConfigurationPage::ConfigurationPage(QWidget *parent)
     : QWidget(parent)
 {
     QGroupBox *configGroup = new QGroupBox(tr(&quot;Server configuration&quot;));

     QLabel *serverLabel = new QLabel(tr(&quot;Server:&quot;));
     QComboBox *serverCombo = new QComboBox;
     serverCombo-&gt;addItem(tr(&quot;Trolltech (Australia)&quot;));
     serverCombo-&gt;addItem(tr(&quot;Trolltech (Germany)&quot;));
     serverCombo-&gt;addItem(tr(&quot;Trolltech (Norway)&quot;));
     serverCombo-&gt;addItem(tr(&quot;Trolltech (People's Republic of China)&quot;));
     serverCombo-&gt;addItem(tr(&quot;Trolltech (USA)&quot;));

     QHBoxLayout *serverLayout = new QHBoxLayout;
     serverLayout-&gt;addWidget(serverLabel);
     serverLayout-&gt;addWidget(serverCombo);

     QVBoxLayout *configLayout = new QVBoxLayout;
     configLayout-&gt;addLayout(serverLayout);
     configGroup-&gt;setLayout(configLayout);

     QVBoxLayout *mainLayout = new QVBoxLayout;
     mainLayout-&gt;addWidget(configGroup);
     mainLayout-&gt;addStretch(1);
     setLayout(mainLayout);
 }

 UpdatePage::UpdatePage(QWidget *parent)
     : QWidget(parent)
 {
     QGroupBox *updateGroup = new QGroupBox(tr(&quot;Package selection&quot;));
     QCheckBox *systemCheckBox = new QCheckBox(tr(&quot;Update system&quot;));
     QCheckBox *appsCheckBox = new QCheckBox(tr(&quot;Update applications&quot;));
     QCheckBox *docsCheckBox = new QCheckBox(tr(&quot;Update documentation&quot;));

     QGroupBox *packageGroup = new QGroupBox(tr(&quot;Existing packages&quot;));

     QListWidget *packageList = new QListWidget;
     QListWidgetItem *qtItem = new QListWidgetItem(packageList);
     qtItem-&gt;setText(tr(&quot;Qt&quot;));
     QListWidgetItem *qsaItem = new QListWidgetItem(packageList);
     qsaItem-&gt;setText(tr(&quot;QSA&quot;));
     QListWidgetItem *teamBuilderItem = new QListWidgetItem(packageList);
     teamBuilderItem-&gt;setText(tr(&quot;Teambuilder&quot;));

     QPushButton *startUpdateButton = new QPushButton(tr(&quot;Start update&quot;));

     QVBoxLayout *updateLayout = new QVBoxLayout;
     updateLayout-&gt;addWidget(systemCheckBox);
     updateLayout-&gt;addWidget(appsCheckBox);
     updateLayout-&gt;addWidget(docsCheckBox);
     updateGroup-&gt;setLayout(updateLayout);

     QVBoxLayout *packageLayout = new QVBoxLayout;
     packageLayout-&gt;addWidget(packageList);
     packageGroup-&gt;setLayout(packageLayout);

     QVBoxLayout *mainLayout = new QVBoxLayout;
     mainLayout-&gt;addWidget(updateGroup);
     mainLayout-&gt;addWidget(packageGroup);
     mainLayout-&gt;addSpacing(12);
     mainLayout-&gt;addWidget(startUpdateButton);
     mainLayout-&gt;addStretch(1);
     setLayout(mainLayout);
 }

 QueryPage::QueryPage(QWidget *parent)
     : QWidget(parent)
 {
     QGroupBox *packagesGroup = new QGroupBox(tr(&quot;Look for packages&quot;));

     QLabel *nameLabel = new QLabel(tr(&quot;Name:&quot;));
     QLineEdit *nameEdit = new QLineEdit;

     QLabel *dateLabel = new QLabel(tr(&quot;Released after:&quot;));
     QDateTimeEdit *dateEdit = new QDateTimeEdit(QDate::currentDate());

     QCheckBox *releasesCheckBox = new QCheckBox(tr(&quot;Releases&quot;));
     QCheckBox *upgradesCheckBox = new QCheckBox(tr(&quot;Upgrades&quot;));

     QSpinBox *hitsSpinBox = new QSpinBox;
     hitsSpinBox-&gt;setPrefix(tr(&quot;Return up to &quot;));
     hitsSpinBox-&gt;setSuffix(tr(&quot; results&quot;));
     hitsSpinBox-&gt;setSpecialValueText(tr(&quot;Return only the first result&quot;));
     hitsSpinBox-&gt;setMinimum(1);
     hitsSpinBox-&gt;setMaximum(100);
     hitsSpinBox-&gt;setSingleStep(10);

     QPushButton *startQueryButton = new QPushButton(tr(&quot;Start query&quot;));

     QGridLayout *packagesLayout = new QGridLayout;
     packagesLayout-&gt;addWidget(nameLabel, 0, 0);
     packagesLayout-&gt;addWidget(nameEdit, 0, 1);
     packagesLayout-&gt;addWidget(dateLabel, 1, 0);
     packagesLayout-&gt;addWidget(dateEdit, 1, 1);
     packagesLayout-&gt;addWidget(releasesCheckBox, 2, 0);
     packagesLayout-&gt;addWidget(upgradesCheckBox, 3, 0);
     packagesLayout-&gt;addWidget(hitsSpinBox, 4, 0, 1, 2);
     packagesGroup-&gt;setLayout(packagesLayout);

     QVBoxLayout *mainLayout = new QVBoxLayout;
     mainLayout-&gt;addWidget(packagesGroup);
     mainLayout-&gt;addSpacing(12);
     mainLayout-&gt;addWidget(startQueryButton);
     mainLayout-&gt;addStretch(1);
     setLayout(mainLayout);
 }</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
